import { http } from '@/utils/request'
import type { Artist, PaginatedResponse, ApiResponse } from '@/types'

// 获取艺人列表
export const getArtistList = (params?: {
  page?: number;
  limit?: number;
  status?: string;
}): Promise<ApiResponse<PaginatedResponse<Artist>>> => {
  return http.get('/client/artists', { params })
}

// 获取艺人详情
export const getArtistDetail = (id: string | number): Promise<ApiResponse<Artist>> => {
  return http.get(`/client/artists/${id}`)
}

// 搜索艺人
export const searchArtists = (keyword: string): Promise<ApiResponse<Artist[]>> => {
  return http.get('/client/artists/search', { params: { q: keyword } })
}

// 检查投票状态
export const checkVoteStatus = (artistId: string | number): Promise<ApiResponse<{ hasVoted: boolean }>> => {
  return http.get(`/client/artists/${artistId}/vote-status`)
} 